require 'rbconfig'

module Videre
  module Configurator
  $sysconfdir= Config::CONFIG["sysconfdir"]
  $videreconfdir="#{$sysconfdir}/videre"

  # Where is our configfile? 
  $configfile="#{$sysconfdir}/videre.conf"

  # parse the options and set global variables
  opts = GetoptLong.new(
     ["--config", "-c", GetoptLong::REQUIRED_ARGUMENT],
     ["--debug", "-d", GetoptLong::NO_ARGUMENT],
     ["--probetype", "-p", GetoptLong::REQUIRED_ARGUMENT]
  )
  opts.each do |opt, arg|
    case opt
      when '--config'
        $configfile = arg
      when '--debug'
        $debug = true
      when '--probetype'
        $probetype = arg
    end
  end
 
  # get the configuration
  $config = YAML.load(File.open($configfile))
  end
end
